package org.example.actualcombat.demos.web.modules.ums.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.actualcombat.demos.web.modules.ums.mapper.UmsMemberLevelMapper;
import org.example.actualcombat.demos.web.modules.ums.model.UmsMemberLevelModel;
import org.example.actualcombat.demos.web.modules.ums.service.UmsMemberLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class UmsMemberLevelServiceImpl extends ServiceImpl<UmsMemberLevelMapper, UmsMemberLevelModel> implements UmsMemberLevelService {
//    @Autowired
//    UmsProductMemberLevelMapper umsMemberMapper;
//    页面里报错了, 就说这个文件有问题. 看下是直接看老师视频还是说 继续改改引入问题
    @Autowired
    UmsMemberLevelMapper umsMemberMapper;
    public List<UmsMemberLevelModel> getMemberList(String defaultStatus) {
        QueryWrapper<UmsMemberLevelModel> priceModelQueryWrapper = new QueryWrapper<>();
        LambdaQueryWrapper<UmsMemberLevelModel> eq = priceModelQueryWrapper.lambda().eq(UmsMemberLevelModel::getDefaultStatus, defaultStatus);
        return   umsMemberMapper.selectList(eq);
//        ArrayList<UmsMemberLevelModel> umsMemberLevelModels = new ArrayList<>();
//        return umsMemberLevelModels;
    }
}
